package com.atguigu.boot.controller;

import com.atguigu.boot.bean.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : leimingchao
 * @date Date : 2021年10月30日 8:36
 */
// @Controller
// @ResponseBody

@RestController
public class HelloController {

    @Autowired
    private Car car;

    @GetMapping(value = "/car")
    public Car car() {
        return car;
    }

    @GetMapping(value = "/hello")
    public String handle01(@RequestParam(name = "name",required = false,defaultValue = "张三") String name) {
        return "Hello,Spring Boot 2!" + "你好" + name;
    }


}
